// 数据源
let arr = [
  { id: 1, icon: 'iconfont icon-lianxikefu', title: '联系客服', className: 'kefu' },
  { id: 2, icon: 'iconfont icon-fenxiang', title: '分享', className: 'share' },
  { id: 3, icon: 'iconfont icon-gouwuche', title: '购物车', className: 'cart' },
]
function initPage() {
  let str = ``
  for (let i in arr) {
    let element = arr[i]
    str += `<div class="${element.className}">
    <i class="${element.icon}"></i>
    <div>${element.title}</div>
  </div>`
  }
  str += `<div class="add-cart">添加购物车</div>
  <div class="buy-now">立即购买</div>`
  document.getElementsByClassName('footer')[0].innerHTML = str
}
initPage()
